package com.windowes.weichang.controller.common;

import com.windowes.weichang.common.ServerResponse;
import com.windowes.weichang.component.jpush.JPushService;
import com.windowes.weichang.component.qiniu.QiniuHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/***
 *
 * @author: yangqing
 * @email: qing.yang@bangdao-tech.com
 * @createTime: 2018/5/28 下午7:08
 * @description:
 *
 **/
@RestController
@Api(description = "通用模块")
public class CommonController {


    @Autowired
    QiniuHelper helper;

    @ApiOperation(value = "获取七牛上传token", notes = "token有效期:3600s")
    @GetMapping("qiniu/upload/token")
    public ServerResponse getQiniuToken() {
        return helper.getToken();
    }

    @Autowired
    JPushService jPushService;


    @GetMapping("push")
    public ServerResponse push() {
        jPushService.pushUser("xxx", "18018378838");
        return ServerResponse.createBySuccess();
    }

}
